import { createSlice, PayloadAction } from "@reduxjs/toolkit"
import { DefaultUser } from "@/constants/user"

const initialState: LoginUser = DefaultUser

const loginUserSlice = createSlice({
  name: "loginUser",
  initialState,
  reducers: {
    setLoginUserAction: (state, action: PayloadAction<LoginUser>) => {
      return {
        ...action.payload
      }
    }
  }
})

export const { setLoginUserAction } = loginUserSlice.actions
export default loginUserSlice.reducer
